<template>
	<page-body>
		<view class="page">
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center tj_flex_0_ibbb">
				<view class='flex flex-direction flex-wrap align-stretch tj_fd0_0_ibbb'>
					<view class='flex flex-wrap align-center tj_fd0_0_c0_ibbb'>
						<text>学院</text>
					</view>
					<view class='flex flex-wrap align-center justify-between tj_fd0_0_c1_ibbb'
						@tap.stop="pickerDiy1756434272860=true">
						<benben-input class='tj_fd0_0_c1_c0_ibbb' type="text" :placeholder="`请选择学院`" confirm-type="done"
							:maxlength="-1" :adjust-position='true' :disabled='true'
							placeholder-style="color:#999;font-size:28rpx" v-model="xy" />
						<text class='fu-iconfont2  tj_fd0_0_c1_c1_ibbb'>&#xe78a;</text>
					</view>
					<view class='flex flex-wrap align-center tj_fd0_0_c0_ibbb'>
						<text>姓名</text>
					</view>
					<view class='flex flex-wrap align-center justify-between tj_fd0_0_c1_ibbb'>
						<benben-input class='tj_fd0_0_c1_c0_ibbb' type="text" :placeholder="`请输入姓名`" confirm-type="done"
							:maxlength="-1" :adjust-position='true' placeholder-style="color:#999;font-size:28rpx"
							v-model="name" />
					</view>
					<view class='flex flex-wrap align-center tj_fd0_0_c0_ibbb'>
						<text>学号</text>
					</view>
					<view class='flex flex-wrap align-center justify-between tj_fd0_0_c1_ibbb'>
						<benben-input class='tj_fd0_0_c1_c0_ibbb' type="text" :placeholder="`请输入学号`" confirm-type="done"
							:maxlength="-1" :adjust-position='true' placeholder-style="color:#999;font-size:28rpx"
							v-model="xh" />
					</view>
					<view class='flex flex-wrap align-center justify-around tj_fd0_0_c6_ibbb'>
						<!--     <view   class='flex flex-wrap align-center justify-center tj_fd0_0_c6_c0_ibbb'      >
        <text class='tj_fd0_0_c6_c0_c0_ibbb'  >取消</text>
</view>
 -->
						<view class='flex flex-wrap align-center justify-center tj_fd0_0_c6_c1_ibbb'
							@tap.stop="tjFunc()">
							<text class='tj_fd0_0_c6_c1_c0_ibbb'>提交</text>
						</view>
					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!--选择器开始 -->
			<benben-picker ref="benbenWritePickerCodepicker1" :visible.sync="pickerDiy1756434272860" :label.sync='xy'
				:value.sync='ids' :options='list' mode='selector' :mask-show='true' :timeout='true' :picker-height='88'
				default-type='aid' :default-props='{"label":"name","value":"aid"}'>
				<template #picker-header>
					<view class='flex flex-wrap align-center justify-between tj_picker1_0_ibbb'>
						<text class='tj_picker1_0_c0_ibbb' @tap="$refs.benbenWritePickerCodepicker1.cancel()">取消</text>
						<text class='tj_picker1_0_c1_ibbb'>选择学院</text>
						<text class='tj_picker1_0_c2_ibbb'
							@tap="$refs.benbenWritePickerCodepicker1.pickerConfirm()">确认</text>
					</view>
				</template>
			</benben-picker>
			<!--选择器结束 -->


		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"pickerDiy1756434272860": false,
				"list": [{
					"name": "学院1",
					"aid": "1"
				}, {
					"name": "学院2",
					"aid": "2"
				}],
				"xy": "",
				"ids": "",
				"name": "",
				"xh": ""
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getlist()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			async getlist() {
				let lists = await this.$api.get(global.apiUrls.post68b02d76e2b25, {

				});

				if (lists.data.code != 1) {
					this.$message.info(lists.data.msg);
					return
				}
				console.log(lists.data)
				this.list = lists.data.data
				// let lists = datauserInfo.data;
				// this.userInfo = infouserInfo.data
			},
			//提交
			async tjFunc() {
				if (!validate(this.xy, 'require')) {
					this.$message.info('请选择学院');
					return false;
				}
				if (!validate(this.name, 'require')) {
					this.$message.info('请输入姓名');
					return false;
				}
				if (!validate(this.xh, 'require')) {
					this.$message.info('请输入学号');
					return false;
				}
				let info = await this.$api.post(global.apiUrls.post68b111532a960, {
					student_id: this.xh,
					name: this.name,
					department_id: this.ids,
				});

				if (info.data.code != 1) {
					this.$message.info(info.data.msg);
					return
				}
				console.log(info.data)
				
				this.$urouter.redirectTo(`/pages/tabBar/jg/jg?type=2`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('1.png')) no-repeat;
		background-size: 100% auto;

		.tj_picker1_0_ibbb {
			padding: 0rpx 32rpx 0rpx 32rpx;
			line-height: 88rpx;
			border-bottom: 1px solid #eee;

			.tj_picker1_0_c0_ibbb {
				color: var(--benbenFontColor2);
			}

			.tj_picker1_0_c1_ibbb {
				color: var(--benbenFontColor0);
			}

			.tj_picker1_0_c2_ibbb {
				color: var(--benbenFontColor4);
			}
		}

		.tj_flex_0_ibbb {
			width: 702rpx;
			height: 980rpx;
			background: url(image-path('2.png')) no-repeat;
			background-size: 100% auto;
			margin: 450rpx auto 0rpx auto;

			.tj_fd0_0_ibbb {
				background: linear-gradient(180deg, #FFFFFF 0%, #F0F5FF 100%);
				width: 654rpx;
				height: 836rpx;
				box-shadow: 0rpx 3rpx 10rpx 1rpx rgba(66, 116, 209, 0.2);
				margin: 120rpx 0rpx 0rpx 24rpx;
				border-radius: 18rpx;
				padding: 0rpx 44rpx 0rpx 44rpx;

				.tj_fd0_0_c6_ibbb {
					margin: 64rpx 0rpx 0rpx 0rpx;

					.tj_fd0_0_c6_c0_ibbb {
						width: 260rpx;
						height: 84rpx;
						border: 1px solid rgba(41, 195, 253, 1);
						border-radius: 16rpx;

						.tj_fd0_0_c6_c0_c0_ibbb {
							color: rgba(47, 113, 249, 1);
							line-height: 84rpx;
							font-size: 32rpx;
						}
					}

					.tj_fd0_0_c6_c1_ibbb {
						background: linear-gradient(28deg, #29C3FD 0%, #2F71F9 100%);
						width: 260rpx;
						height: 84rpx;
						border-radius: 16rpx;

						.tj_fd0_0_c6_c1_c0_ibbb {
							font-size: 32rpx;
							color: var(--benbenFontColor3);
							line-height: 84rpx;
						}
					}
				}
			}
		}

		.tj_fd0_0_c0_ibbb {
			margin-top: 44rpx;
			margin-bottom: 18rpx;
			line-height: 46rpx;
			font-size: 32rpx;
			color: rgba(19, 30, 53, 1);
		}

		.tj_fd0_0_c1_ibbb {
			border: 1px solid #eee;
			height: 84rpx;
			width: 558rpx;
			padding: 0rpx 24rpx 0rpx 24rpx;
			margin: 0rpx 0rpx 12rpx 0rpx;
			background: var(--benbenbgColor1);
			background-size: 100% auto;

			.tj_fd0_0_c1_c1_ibbb {
				font-size: 20rpx;
			}
		}

		.tj_fd0_0_c1_c0_ibbb {
			height: 50rpx;
		}
	}
</style>
